<?php if($this->params['isAjax'] == false)
{?>
	<?php echo $form->input('category',array('onchange'=>"getSearchForm(this);",'value'=>$categoryId,'empty'=>__("-Select-"),'options'=>$categories,'label'=>false))?>
<?php }?>
<div id="adavnced_search_form">
	<?php 
		$emptyField =  $form->input("__empty",array('type'=>"hidden"));
		echo $listingSearchForm->create('Listing',array('url'=>"/".$this->params['url']['url'])); 
		echo $emptyField;
		echo $listingSearchForm->inputs($fields);
		echo $listingSearchForm->end(__("Search"));
	?>
</div>

<?php if($this->params['isAjax'] == false)
{?>
	<script type="text/javascript">
	function getSearchForm(obj)
	{
		$('#adavnced_search_form').html('<img src="'+AJAX_LOADING_IMG+'"/>');
		var url = "<?php echo $html->url(array('action'=>"advancedSearch"))?>";
		url += '/'+$(obj).val(); 
		$('#adavnced_search_form').load(url+" #adavnced_search_form",function(){
			
		});
	}
	
	</script>
<?php }?>